package pack;

public class Caissier extends Thread{
	int id;
	int nbCommande;
	Caisse ca;
	Rayon bigMacs;
	Rayon frites;
	public Caissier(int id, Caisse ca, Rayon bigMacs, Rayon frites) {
		super();
		this.id = id;
		this.ca = ca;
		this.bigMacs = bigMacs;
		this.frites = frites;
		this.nbCommande=0;
	} 
	
	public void run(){
		for (int turn=0; turn<100; turn++){
			ca.doitPreparerCommande();
			System.out.println("Caissier "+id+" a recu une commande");
			bigMacs.prend();
			System.out.println("Caissier "+id+" : "+bigMacs.getNom()+" pris");
			frites.prend();
			System.out.println("Caissier "+id+" : "+frites.getNom()+" prises");
			nbCommande++;
			System.out.println("Caissier "+id+" a fini sa commande "+nbCommande);
			ca.commandeEstPrete();
		
		}
	}
	
	
}
